package com.wx.reflect;

import java.lang.annotation.Annotation;

public class ReflectUtil {


    public static <A extends Annotation> A getAnnotation(String className, Class<A  > annotationClass) throws ClassNotFoundException {
        Class<?> aClass = Class.forName(className);
        A annotation = aClass.getAnnotation(annotationClass);
        if(annotation!=null){
            return annotation;
        }
        return null;
    }

    public static  Class getInterFaceClass(String className){
        try {
            Class<?> aClass = Class.forName(className);
            return aClass;
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        return null;
    }
}
